/*
 * @LastEditors: yuSeen
 * @LastEditTime: 2022-01-11 11:43:33
 */
// @ts-ignore
const { BrowserWindow, ipcMain } = require("electron");
const path = require("path")

// 创建登录窗体
const loginWindow = () => {
  ipcMain.on("create-login-window", (event, arg) => {
    const win = new BrowserWindow({
      frame: false,
      width: 350,
      height: 530,
      resizable: false,
      webPreferences: {
        preload: path.join(__dirname, "../../electron/preload.ts"),
        nodeIntegration: true,
        contextIsolation: false,
        enableRemoteModule: true,
      },
    });
    win.loadURL("http://localhost:22106/#/login");

    ipcMain.on('close-login-window', () => win.close())
  });
};

module.exports = loginWindow;
